<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网上商城</title>
    <link rel="stylesheet" th:href="@{~/bootstrap/css/bootstrap.min.css}">
    <script th:src="@{~/js/jquery-3.2.1.min.js}"></script>
    <style>
        .content{
            margin: auto;
            width: 500px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="content">
            <form class="form-horizontal" action="/user/update" method="post" enctype="multipart/form-data">
                <input name="id" hidden th:value="${user.id}"/>
                <input name="img" hidden th:value="${user.img}"/>
                <div class="form-group">
                  <label for="uname" class="col-sm-2 control-label">姓名</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="uname" th:value="${user.uname}" id="uname" placeholder="姓名">
                  </div>
                </div>
                <div class="form-group">
                  <label for="pwd" class="col-sm-2 control-label">密码</label>
                  <div class="col-sm-10">
                      <input type="password" class="form-control" name="password" th:value="${user.password}" id="pwd" placeholder="密码">
                  </div>
                </div>
                <div class="form-group">
                    <label for="phone" class="col-sm-2 control-label">手机号</label>
                    <div class="col-sm-10">
                        <input type="text" th:value="${user.phone}" name="phone" class="form-control" id="phone" placeholder="请输入手机号">
                    </div>
                </div>
                <div class="form-group">
                    <label for="img">头像</label>
                    <div class="col-sm-10">
                        <input type="file" name="mfile" id="img">
                        <p class="help-block"></p>
                        <img class="img-circle" width="30" height="30" th:src="@{~/img/{img}(img=${user.img})}">
                    </div>
                </div>
                <div class="form-group">
                  <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-info">修改</button>
                  </div>
                </div>
              </form>
        </div>
    </div>
</body>
</html>